package com.woniu.immunologicalmechanism.controller;

import com.woniu.common.entity.ImmuneRegister;
import com.woniu.common.entity.ResponseResult;
import com.woniu.immunologicalmechanism.service.ImmuneRegisterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/register")
@Api(tags = "免疫登记接口")
public class ImmuneRegisterController {
    @Autowired
    ImmuneRegisterService immuneRegisterService;


    @ApiOperation("添加免疫登记")
    @GetMapping("/add")
    public ResponseResult add(ImmuneRegister immuneRegister){
      //  System.out.println(immuneRegister);
        return immuneRegisterService.addimmuneRegister(immuneRegister);
    }
    @ApiOperation("修改免疫登记")
    @GetMapping("/update")
    public ResponseResult update(ImmuneRegister immuneRegister){
        //System.out.println(immuneRegister);
        return immuneRegisterService.updateimmuneRegister(immuneRegister);
    }
    @ApiOperation("根据免疫登记id查询免疫登记")
    @PostMapping("/get")
    public ResponseResult get(int iid){

        return immuneRegisterService.getimmuneRegister(iid);
    }
    @ApiOperation("根据核验信息id查询免疫登记")
    @GetMapping("/getbyoid")
    public ResponseResult getimmuneRegisterByOid(int oid){
        //System.out.println(oid);

        return immuneRegisterService.getimmuneRegisterByOid( oid);
    }
}
